import localforage from 'localforage';
import config from '@/config/index';
const get = (key: string): Promise<unknown> =>
  localforage.getItem(`${config.storageKeyPrefix}${key}`);
//   需要重新格式化一下，否则会有proxy
const set = (key: string, value: any): Promise<unknown> =>
  localforage.setItem(`${config.storageKeyPrefix}${key}`, JSON.parse(JSON.stringify(value)));
export { get, set };
